<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<div class="bg-content">
	<div class="col-xs-11">
		<div class="row">
			<div class="row-md-4 span8">
			</div>
			<article class="span8">
				<h3>修改用户信息</h3>
				<div class="inner-1">
					<form id="contact-form" action="${pageContext.request.contextPath}/manager/user/update" method="post">
						<input type="hidden" name="id" value="${user.id} ">
						<fieldset>
							 <div>
							    <label>用户名</label>
							    <input type="text" name="username" class="form-control" placeholder="用户名" required autofocus value="${user.username }">
						    </div>
						    <div>
								<label>部门：</label>
								<select name="departmentId" class="form-control" required>
									<c:forEach items="${departments }" var="department">
										<c:if test="${department.id==user.departmentId }">
											<option value="${department.id }" selected="selected">${department.name }</option>
										</c:if>
										<c:if test="${department.id!=user.departmentId }">
											<option value="${department.id }">${department.name }</option>
										</c:if>
									</c:forEach>
								</select>
							</div>
							<div>
								<label>年龄：</label>
								<input type="text" name="age" class="form-control" required value="${user.age }">
							</div>
							<div>
								<label>性别：</label>
								<label class="radio-inline">
									<c:if test="${user.sex==0 }">
									  <input type="radio" name="sex" value="0" checked="checked"> 男
									</c:if>
									<c:if test="${user.sex!=0 }">
									  <input type="radio" name="sex" value="0"> 男
									</c:if>
								</label>
								<label class="radio-inline">
									<c:if test="${user.sex==1 }">
								  		<input type="radio" name="sex" value="1" checked="checked"> 女
								  	</c:if>
								  	<c:if test="${user.sex!=1 }">
								  		<input type="radio" name="sex" value="1"> 女
								  	</c:if>
								</label>
							</div>
							<div>
								<label>职位：</label>
								<input type="text" name="title" class="form-control" required value="${user.title }">
							</div>
							<div>
								<label>手机号：</label>
								<input type="text" name="mobile" class="form-control" required value="${user.mobile }">
							</div>
							<div>
								<label>Email：</label>
								<input type="email" id="email" name="email" class="form-control" required value="${user.email }">
							</div>
							<div>
								<label>公司：</label>
								<input type="text" name="company" class="form-control" required value="${user.company }">
							</div>
						</fieldset>
						<br />
					    <button class="btn btn-lg btn-primary btn-block" type="submit">保存</button>
					</form>
				</div>
			</article>
		</div>
	</div>
</div>
